package com.sikaryofficial.backend.loader;

import com.sikaryofficial.backend.annotation.TenantFilter;
import com.sikaryofficial.backend.service.article.cache.ArticleCacheService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author : qinjinyuan
 * @desc : 文章子标题数据预热
 * @date : 2023/11/28 8:59
 */
@Component
@Slf4j
public class ArticleLoader implements CommandLineRunner {
    @Autowired
    private ArticleCacheService articleCacheService;
    @Override
    @TenantFilter
    public void run(String... args) {
        log.info("start: 文章logo数据预热=================================");
        articleCacheService.loadArticleStatistics();
        log.info("end: 文章logo数据预热=================================");
    }
}
